package com.lnu.information.exception;

import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;

/**
 * @author : jian.zhang-2
 * @description:
 * @date : Create in 4:12 PM 2022/4/28
 * @modified By :
 */
public class ReflectEx {
//    private static final String[] Constructor[] = null;

    public static void main(String[] args) {
        Rect rect = new Rect();
        Class cs = rect.getClass();
        System.out.println(cs == Rect.class);
        Constructor[] con = cs.getDeclaredConstructors();
        Field[] field = cs.getDeclaredFields();
        Method[] methods = cs.getDeclaredMethods();
        System.out.println("类的名字：" + cs.getName());
        System.out.println("类中有如下的构造方法");
        for(int i = 0; i < con.length; i++ ){
            System.out.println(con[i].toString());
        }
        for(int i = 0; i < field.length; i++ ){
            System.out.println(field[i].toString());
        }
        for(int i = 0; i < methods.length; i++ ){
            System.out.println(methods[i].toString());
        }
    }
}
